package com.repair.miniApp.controller;

import com.repair.common.core.domain.AjaxResult;
import com.repair.miniApp.domain.DictData;
import com.repair.miniApp.service.DictDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/dict-data")
public class DictDateController {

    @Autowired
    private DictDataService dictDataService;

    @GetMapping("/building-number")
    public AjaxResult getBuildingNumberData() {
        List<DictData> buildingNumberData = dictDataService.getBuildingNumberData();
        return AjaxResult.success(buildingNumberData);
    }

    @GetMapping("/repair-type")
    public AjaxResult getRepairTypeData() {
        List<DictData> repairTypeData = dictDataService.getRepairTypeData();
        return AjaxResult.success(repairTypeData);
    }
}
